window['p']={
	//默认选项
	opts:{
		width:200,
		max:100,
		value:10,
		parentElem:undefined
	},
	//保存所有的opts选项
	allOpts:[],
	init:function(opts){
		var opt = $.extend(this.opts,opts);
		this.allOpts.push(opt);
		var $progress = $(t.replaceParams(t.progress,{
			text:opt.value+"/"+opt.max,
			maxWidth:opt.width+"px",
			valueWidth:(opt.value*opt.width/opt.max)+"px",
			progress:this.allOpts.length-1
		}));
		opt.parentElem.append($progress);
		return $progress;
	},
	setProgressValue:function($progress,val){
		var index = parseInt($progress.attr("progress"));
		opt = this.allOpts[index];
		opt.value = val;
		//设置宽度
		$progress.find(".progress-value").width((opt.value*opt.width/opt.max)+"px");
		//设置文本内容
		$progress.find(".progress-text .progress-span").text(opt.value+"/"+opt.max);
	}
}
